package com.chen.recruit.domain;

import com.chen.recruit.common.enums.CollegeType;
import com.chen.recruit.common.enums.CommonStatus;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 院系对象 t_college
 *
 * @author cgy
 * @date 2022-08-20
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("College 院系对象")
public class College extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 院系id
     */
    @ApiModelProperty("院系id")
    @Null(message = "新增院系id必须为空", groups = AddGroup.class)
    @NotNull(message = "更新院系id不能为空", groups = UpdateGroup.class)
    private Integer id;

    /**
     * 父院系id
     */
    @ApiModelProperty("父院系id")
    @NotNull(message = "父院系id不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer parentId;

    /**
     * 祖级列表
     */
    @ApiModelProperty("祖级列表")
    private String ancestors;

    /**
     * 院系名称
     */
    @ApiModelProperty("院系名称")
    @NotBlank(message = "院系名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    /**
     * 院系类型（0学院 1分院 2专业 3班级）
     */
    @ApiModelProperty("院系类型（0学院 1分院 2专业 3班级）")
    @NotNull(message = "院系类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private CollegeType type;

    /**
     * 院系状态（1启用 0禁用）
     */
    @ApiModelProperty("院系状态（1启用 0禁用）")
    @NotNull(message = "院系状态不能为空", groups = UpdateGroup.class)
    private CommonStatus status;

}
